package chapter06.E19;

import java.util.Iterator;
import java.util.Set;
import java.util.TreeMap;

public class E19 {
    public static void main(String[] args) {
        TreeMap map = new TreeMap();
        map.put(3, "李四");
        map.put(1, "王五");
        map.put(4, "赵六");
        map.put(3, "张三");
        //导出key队列(map有key队列和value)
        Set KeySet = map.keySet();
        //获取到TreeSet以后 排序显示
        Iterator it = KeySet.iterator();
        while (it.hasNext()) {
            Object key = it.next();
            Object value = map.get(key);
            System.out.println(key + ":" + value);
        }
    }
}
